//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Policy Injection Application Block
//===============================================================================

using System;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using EntLibContrib.PolicyInjection.Configuration.Design.MatchingRules;
using EntLibContrib.PolicyInjection.Configuration.Design.Properties;

namespace EntLibContrib.PolicyInjection.Configuration.Design
{
	/// <summary>
	/// Policy Injection Node Map Registrar
	/// </summary>
	internal class PolicyInjectionNodeMapRegistrar : NodeMapRegistrar
	{
		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="PolicyInjectionNodeMapRegistrar"/> class.
		/// </summary>
		/// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		public PolicyInjectionNodeMapRegistrar(IServiceProvider serviceProvider)
			: base(serviceProvider)
		{ }
		#endregion

		#region Public Methods
		/// <summary>
		/// Registers the node maps.
		/// </summary>
		public override void Register()
		{
			base.AddMultipleNodeMap(Resources.NotMatchingRuleName,
				typeof(NotMatchingRuleNode),
				typeof(NotMatchingRuleData));
			base.AddMultipleNodeMap(Resources.AndMatchingRuleName,
				typeof(AndMatchingRuleNode),
				typeof(AndMatchingRuleData));
			base.AddMultipleNodeMap(Resources.OrMatchingRuleName,
				typeof(OrMatchingRuleNode),
				typeof(OrMatchingRuleData));
		}
		#endregion
	}
}